package com.wngbms.websocket.login;

import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;

import java.net.URI;

@Slf4j
public class MyWebSocketClient extends WebSocketClient {
    public MyWebSocketClient(URI serverUri) {
        super(serverUri);
    }

    @Override
    public void onOpen(ServerHandshake serverHandshake) {
        log.info("open {}", serverHandshake);
    }

    @Override
    public void onMessage(String s) {
        log.info("message {}", s);
    }

    @Override
    public void onClose(int i, String s, boolean b) {
        log.info("close {}", s);
    }

    @Override
    public void onError(Exception e) {
        log.error("error", e);
    }
}
